618a49983898cd867331222148d9a2dbba4b255a,PlugIns/PostgresqlPlugIn/Sources/com/webobjects/jdbcadaptor/PostgresqlExpression.java,PostgresqlExpression,sqlStringForValue,#Object#String#,145

Before Change


    static NSTimestampFormatter timestampFormatter = new NSTimestampFormatter("%Y-%m-%d %H:%M:%S.%F");

    public String sqlStringForValue(Object v, String kp) {
        String result = super.sqlStringForValue(v,kp);
        if(v != null && v != NSKeyValueCoding.NullValue) {
            EOAttribute attribute;
            int lastDotIdx = kp.lastIndexOf(".");
            if (lastDotIdx == -1) {
                attribute = entity().attributeNamed(kp);
            } else {
                EOEntity kpEntity = entityForKeyPath(kp);
                attribute = kpEntity.attributeNamed(kp.substring(lastDotIdx+1));
            }
            if(attribute != null) {
                String s = columnTypeStringForAttribute(attribute);
                //handel millis seconds, too.
                if (v instanceof NSTimestamp) {
                    NSTimestamp t = (NSTimestamp)v;
                    String timestampString = "'"+timestampFormatter.format(t) + "'";
                    result = timestampString;
                }
                result = result + "::" + s;
            }
        }
        return result;
    }

    /** Helper class to store a join definition */

After Change


            return super.sqlStringForValue(v,kp) + "::" + s;
        } 
        
        return super.sqlStringForValue(v,kp);
    }
    
    /**